const Joi = require("joi");

const id = Joi.number().integer().min(1).required();
const animename = Joi.string().min(1).max(20).required();
const c_name = Joi.string().min(1).max(20);
const country = Joi.number().integer().valid(0, 1, 2, 3);
const intro = Joi.string().min(1).max(500);
const premiere = Joi.date();
const op = Joi.string();
const ed = Joi.string();
const update = Joi.string();

//新增数据验证
exports.add_Schema = {
	body: {
		animename,
		c_name,
		country,
		intro,
		op,
		ed,
		premiere,
		update,
	}
};

// 更新数据
exports.update_Schema = {
	body: {
		animename,
		c_name,
		country,
		intro,
		op,
		ed,
		premiere,
		update,
		id
	}
};